/*** Eclipse Class Decompiler plugin, copyright (c) 2012 Chao Chen (cnfree2000@hotmail.com) ***/
package com.qihoo.b;

import javax.crypto.Cipher;
import javax.crypto.SecretKey;
import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.DESKeySpec;
import javax.crypto.spec.IvParameterSpec;

public class b {
    public static String a(byte[] paramArrayOfByte, String paramString) {
        String str = null;
        if (paramArrayOfByte != null)
            try {
                DESKeySpec localDESKeySpec = new DESKeySpec(paramString.getBytes("UTF-8"));
                SecretKeyFactory localSecretKeyFactory = SecretKeyFactory.getInstance("DES");
                SecretKey localSecretKey = localSecretKeyFactory.generateSecret(localDESKeySpec);
                Cipher localCipher = Cipher.getInstance("DES/CBC/PKCS5Padding");
                IvParameterSpec localIvParameterSpec = new IvParameterSpec(paramString.getBytes("UTF-8"));
                localCipher.init(2, localSecretKey, localIvParameterSpec);
                byte[] arrayOfByte = localCipher.doFinal(paramArrayOfByte);
                str = new String(arrayOfByte, "UTF-8");
            } catch (Exception localException) {
                localException.printStackTrace();
            }
        return str;
    }
}